from fastapi import APIRouter, Depends

from forward.api.h5.schemas.merchant import MerchantAddInSchema, MerchantListInSchema
from forward.api.h5.service.lucky.merchant import MerchantService
from forward.dependencies.verify import h5_admin_verify


merchant = APIRouter(prefix="/merchant")


@merchant.post("/lists", dependencies=[Depends(h5_admin_verify)])
async def list(
    list_in: MerchantListInSchema, merchant_service: MerchantService = Depends()
):
    return await merchant_service.lists(list_in)


@merchant.post("/add", dependencies=[Depends(h5_admin_verify)])
async def add(
    add_in: MerchantAddInSchema, merchant_service: MerchantService = Depends()
):
    return await merchant_service.add(add_in)
